package com.brkj.test;

import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.TextView;
import com.brkj.httpInterface.BaseAjaxParams;
import com.brkj.httpInterface.HttpInterface.HIF_GetExamDetail;
import com.brkj.main.R;
import com.brkj.test.model.DS_Exam;
import com.brkj.test.model.DS_Exam_detail_ques;
import com.brkj.test.model.DS_QuesRecord;
import com.brkj.util.ConstAnts;
import com.dgl.sdk.util.DBStore;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import net.tsz.afinal.FinalDb;
import net.tsz.afinal.FinalHttp;
import net.tsz.afinal.http.AjaxCallBack;

import java.io.Serializable;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

public class ExamWrongQuesAdapter extends BaseAdapter{

	private ListItemView listItemView;
	protected LayoutInflater listContainer;
	private Context context;
	private List<DS_Exam_detail_ques> examList;
	private boolean isOffLineList;

	public ExamWrongQuesAdapter(Context context, List<DS_Exam_detail_ques> examList){
		this.context = context;
		this.examList = examList;
		this.isOffLineList = isOffLineList;

		listContainer = LayoutInflater.from(context);

	}
	
	private static class ListItemView{
		public TextView content;
	};
	
	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return examList.size();
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		// 自定义视图
		listItemView = new ListItemView();
		// 获取list_item布局文件的视图
		if (convertView == null) {
			convertView = listContainer.inflate(R.layout.exam_wrong_ques_list_item, null);
			// 获取控件对象
			listItemView.content = (TextView) convertView
					.findViewById(R.id.Title);

			// 设置控件集到convertView
			convertView.setTag(listItemView);
		} else {
			listItemView = (ListItemView) convertView.getTag();
		}
		
		
		listItemView.content.setText(examList.get(position).getQuestion());

		return convertView;
	}


}
